$(document).ready(function(){


// header:s
var scroll_header = 0
$(window).scroll(function(){
	if($(window).scrollTop() > 50){
		if(scroll_header == 1) return;
		scroll_header=1
		$(".scroll_top").stop().fadeIn(300)
	}else{
		scroll_header=0
		$(".scroll_top").stop().fadeOut(150)
	}
})
$(".scroll_top").click(function(){
	$("html, body").stop().animate({scrollTop:0},300)
	return false;
})
$(".header_left .center").mCustomScrollbar({
    axis:"y", // horizontal scrollbar
	theme:"dark"
})
$("#collect").click(function(){
   var ctrl=(navigator.userAgent.toLowerCase()).indexOf('mac')!=-1?'Command/Cmd': 'CTRL';
   if(document.all){
	   window.external.addFavorite('http://video.1haza.com', '일하자영화');
	   }
	   else if(window.sidebar){
	   window.sidebar.addPanel('일하자영화', 'http://video.1haza.com', "");
	   }
	   else{ alert('您可以通过快捷键' + ctrl + ' + D 加入到收藏夹');}
})
// header:e

// visual:s
$(".visual .wrap").slick({
	infinite: true,
	vertical: false,
	pauseOnHover: false,
	arrows: false,
	prevArrow: '<button type="button" data-role="none" class="slick-prev"><i class="xi-angle-left-thin"></i></button>',
	nextArrow: '<button type="button" data-role="none" class="slick-next"><i class="xi-angle-right-thin"></i></button>',
	dots: false,
	centerMode: false,
	centerPadding: 0,
	slidesToShow: 1,
	slidesToScroll: 1,
	autoplay: true,
	autoplaySpeed: 2000,
	speed: 1000,
})
// visual:e


// video:s
$(".video_head .menu li").click(function(){
	$(".video_head .menu li").removeClass("on")
	$(this).addClass("on")
})
$(".video_head .menu2 li").click(function(){
	$(".video_head .menu2 li").removeClass("on")
	$(this).addClass("on")
})
$(".video .main_list .wrap").slick({
	infinite: true,
	vertical: false,
	pauseOnHover: false,
	arrows: false,
	prevArrow: '<button type="button" data-role="none" class="slick-prev"><i class="xi-angle-left-thin"></i></button>',
	nextArrow: '<button type="button" data-role="none" class="slick-next"><i class="xi-angle-right-thin"></i></button>',
	dots: false,
	centerMode: false,
	centerPadding: 0,
	slidesToShow: 3,
	slidesToScroll: 3,
	autoplay: false,
	autoplaySpeed: 2000,
	speed: 500,
})
$(".ranking_list .wrap").slick({
  infinite: true,
  vertical: false,
  pauseOnHover: false,
  arrows: false,
  prevArrow: '<button type="button" data-role="none" class="slick-prev"><i class="xi-angle-left-thin"></i></button>',
  nextArrow: '<button type="button" data-role="none" class="slick-next"><i class="xi-angle-right-thin"></i></button>',
  dots: false,
  centerMode: false,
  centerPadding: 0,
  variableWidth: true,
  slidesToShow: 1,
  slidesToScroll: 1,
  autoplay: false,
  autoplaySpeed: 3000,
  speed: 1000,
})
// video:e


// banner:s
$(".banner").slick({
	infinite: true,
	vertical: false,
	pauseOnHover: false,
	arrows: false,
	prevArrow: '<button type="button" data-role="none" class="slick-prev"><i class="xi-angle-left-thin"></i></button>',
	nextArrow: '<button type="button" data-role="none" class="slick-next"><i class="xi-angle-right-thin"></i></button>',
	dots: false,
	centerMode: true,
	centerPadding: "20%",
	slidesToShow: 1,
	slidesToScroll: 1,
	autoplay: true,
	autoplaySpeed: 1500,
	speed: 500,
})
// banner:e


// detail:s
$(".detail .page").mCustomScrollbar({
    axis:"x", // horizontal scrollbar
	theme:"dark"
})
var dpul = $(".detail .page ul li").length
$(".detail .page ul").css({width:dpul*85+20+"px"})
// detail:e







 

})









